import { rowsToOptions } from "@/hook/common";
import { queryModel } from "./model";

export const modelOptions = ref();

export const queryModelOptions = async () => {
  if (!modelOptions.value) {
    const data = await queryModel();
    modelOptions.value = rowsToOptions({
      labelKey: "description",
      valueKey: "id",
      rows: data.data
    });
  }
};
